
from django.db import models

from utils.model import BaseModel


# Create your models here.


class NavCategory(BaseModel):
    """
    导航分类
    """

    name = models.CharField(max_length=20,verbose_name="导航名称")
    display_name = models.CharField(max_length=20,verbose_name="导航显示名称")
    weight = models.IntegerField(default=0,verbose_name="权重")
    external_link = models.URLField(verbose_name="外链地址",blank=True)


    class Meta:
        verbose_name = "导航分类"
        verbose_name_plural = verbose_name
        db_table = "tb_nav_category"
        ordering = ["weight"]

    def __str__(self):
        return self.name